Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unbranded template available for use in app/views #638

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

kr8n3r
Copy link

@kr8n3r kr8n3r commented Nov 8, 2018

Enable unbranded template to be easily usable in the app views.

Fixes: #602

Example using the unbranded layout
screen shot 2018-11-08 at 10 46 35

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-prototype-kit-pr-638 November 8, 2018 10:51 Inactive
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @igloosi 👍

@kr8n3r kr8n3r added this to the [NEXT] milestone Nov 8, 2018
@kr8n3r kr8n3r merged commit 82b9837 into master Nov 8, 2018
@kr8n3r kr8n3r deleted the make-unbranded-template-available-in-app-views branch November 8, 2018 16:52
kr8n3r pushed a commit that referenced this pull request Nov 19, 2018
New features:

- [#642 Update GOV.UK Frontend to v2.4.0](#642)

Bug fixes:

- [#634 Avoid double-nested buttons in step-by-step navigation](#634)

- [#638 Make unbranded template available for use in app/views](#638)
@kr8n3r kr8n3r mentioned this pull request Nov 19, 2018
fofr added a commit to DFE-Digital/publish-teacher-training-prototype that referenced this pull request Feb 4, 2019
* Add missing value (data) attribute

Currently, if a user enters an answer on examples/pass-data/vehicle-registration and then clicks 'Change' on examples/pass-data/vehicle-check-answers the previously filled answer is lost. Adding in the data element would show the user's answer back to them (the radio button and checkbox example pages work as expected).

* Update branching example

- Use post and session data instead of get and query data
- Tidy up code by putting example files in a folder

* changelog

* Update basic-auth from 1.0.3 to 2.0.0

basic-auth 2.0.0 drops support for Node.js below 0.8, but we require Node 8.0.It also removes support for passing the context directly to the auth function, but that's ok because we pass the request object.

Tested by adding the following to the .env file and ensuring that basic auth still functions:

USERNAME=foo
PASSWORD=bar
NODE_ENV=production
USE_HTTPS=false

* Update link to 'set username and password' in docs

* Update cross-spawn from 5.0.0 to 6.0.5

cross-spawn 6.0 removes support for older node versions, only node >= 4 is supported. This is OK because we already require node >= 8.

Tested by making sure that the Prototype Kit still runs without error.

* Update dotenv from 4.0.0 to 6.0.0

dotenv 6.0 drops support for node v4, but this is fine because we already require node v6.

Other breaking changes are:
- default path is now path.resolve(process.cwd(), '.env')
- does not write over keys already in process.env if the key has a falsy value

Neither of these should affect the kit.

Tested by adding `FOO=bar` to the `.env` file, and ensuring that it is available within the app by adding a `console.log(process.env.FOO)` and checking for 'bar' in the console output.

* Update express from 4.15.2 to 4.16.3

Only bugfixes, features and dependency updates.

* Update gulp-clean from 0.3.2 to 0.4.0

Tested by running `gulp clean` and checking that the public directory is removed.

* Update gulp-mocha from v4.3.1 to v6.0.0

There are no release notes or changelog for this module, but looking at sindresorhus/gulp-mocha@v4.0.0...v6.0.0 v6.0 drops support for anything below Node 6. This should be fine, as we require Node 8 or above anyway.

Once updated, the tests started 'hanging' – updating the mocha gulp task to use the example from their readme (passing exit: true) solved this.

* Update gulp-sass from 3.1.0 to 4.0.1

gulp-sass 4.0 drops support for Node < 4, but this is fine because we require node 8 anyway.

Tested by running `gulp clean` to remove the public directory, then running `npm start` and ensuring that the stylesheet is re-generated and the prototype kit app looks correct.

* Update marked from 0.3.6 to 0.4.0

Fixes a number of security vulnerabilities, fixes a load of bugs and adds a number of new features.

Some of these are listed as breaking changes, but only because they fix bugs so the output would be different.

Tested by going through the documentation (which is written in markdown) and checking that it looks OK.

* Update notifications-node-client from 3.0.0 to 4.1.0

This package isn't actually require'd or used anywhere in the application – it's pre-installed to make it easier for prototype kit users to get setup with Notify.

* Remove unused readdir dependency

This is no longer used as of 6ff3b6b.

* Update require-dir from 0.3.2 to 1.0.0

Tested by ensuring that gulp tasks are still included from the gulp directory (the only place that require-dir is used is in gulpfile.js, where it includes the tasks from ./gulp.

* Update run-sequence from 1.2.2 to 2.2.1

Tested by ensuring that the gulp tasks in gulp/tasks.js that use run-sequence still run without error.

* Update standard from 10.0.2 to 11.0.1 and fix violations

* Update sync-request from 4.1.0 to 6.0.0

Tested by ensuring that the release url on the `/docs/install` page is still generated correctly (sync-request is only used by the getLatestRelease in lib/utils, which is used on the /docs/install page to automatically link to the latest release from GitHub)

* Document changes in changelog

* Update govuk-frontend dependency to 1.1.1

* Unify download link approach

Within the docs we link to `/prototype-admin/download-latest` which looks up the latest release from GitHub and redirects to the zip download.

On the install page itself, we look up the latest release URL and then link directly to GitHub from the page.

This moves the `/prototype-admin/download-latest` to `/docs/install` so that it can live within the docs folder and unifies the two approaches so that we consistently use the `/docs/download` URL. This means that we are no longer blocking on a GitHub request before we can render the install page – and that we only make the request to GitHub if the user actually tries to download the kit.

* Simplify getLatestRelease logic

- Rather than trying to extract the tag name from the zipball URL, use the value of `name` that we get in the response data
- Use template literals to build the zip URL rather than multiple variables and concatenation
- Avoid assigning things to variables that aren't used more than once (githubUrl, options) which also reduces the amount of seeking you have to do through the code
- Remove url, zipUrl variables by assigning to releaseUrl directly and `return`ing from every scenario

* Specify node dependency using caret notation

This fixes an issue when deploying to CloudFoundry instances (such as GOV.UK PaaS) where the buildpack fails on the semver range:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): >=8.9.1 <9.0
          engines.npm (package.json): unspecified (use default)
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
          **ERROR** Unable to install node: improper constraint: >=8.9.1 <9.0
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
```

Using ^8.9.1 instead which is semantically equivalent (any version greater than 8.9.1 but less than 9.0) allows the app to deploy successfully:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): ^8.9.1
          engines.npm (package.json): unspecified (use default)
   -----> Installing node 8.11.3
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-8.11.3-linux-x64-34b80d71.tgz]
```

* Document in changelog

* Add data- tracking attributes to docs/index page

* Add data- tracking attributes to header navigation

Unfortunately at the moment we cannot pass
data attributes to items, so we have to replace
the Nunjucks macro with HTML.

* Add example of using data in Nunjucks macros

* Document in CHANGELOG

* Simplify start page

As seen in this PR: alphagov/govuk-frontend#807

* Improve error handling

- Use 'next' and middleware to handle errors, this is the documented way to handle errors in Express
- Use console.error to output errors when rendering templates - these were previously hidden
- Remove custom route for index.html, handle it with matchRoutes for consistency

* update changelog

* Document steps needed when updating the kit

from version beta-9 to beta-10

* Update GOV.UK Frontend to 1.2.0

* Document in CHANGELOG

* Add Elements, Frontend Toolkit and GOV.UK Template modules

* Add gulp tasks for v6 support

* create v6 app to serve old prototype files from app/v6

* add backward compatibility documentation

* update changelog

* support old unbranded template

* v7.0.0

* Update install-the-kit.md

- correct reference to '3.0.0' folder
- simplify instructions for just installation, not returning
- drop instructions for 'My Documents' - this was for Windows older than Vista apparently

* Update template-question-page-blank.html

Link to the home page instead of the Question page pattern - people could need any of the components or patterns, not necessarily guidance on the Question page itself

* Update CHANGELOG.md

* rename and reorganise template pages to be easier to use

* update changelog

* Add prototype kit version and github link to footer

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Add item to CHANGELOG for adding kit version to footer

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Amend prototype kit link to go to heroku site

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Changed block name to bodyEnd to fix scripts

* Update CHANGELOG.md

* Update GOV.UK Frontend to 1.3.0

* Document in CHANGELOG

* Load environment variables before requiring routes

Code in `route.js` may be looking for environment variables. If the environment variables aren’t loaded beforehand this will cause an exception.

I suspect this worked fine before alphagov/govuk-prototype-kit@bbe15e8#diff-78c12f5adc1848d13b1c6f07055d996e, which reordered the first lines in `server.js`.

This commit moves the loading of environment variables to before the requiring of any `routes.js` files.

* CHANGELOG

* v7.1.0

* Updating deprecated support email address

* Restart the app if environment variables change

Could be confusing why your changes aren’t having any effect.

Doing this using the existing file-extension-based config doesn’t work
because nodemon doesn’t undestand that `.env` is a file with no name,
and an extension of `env`. So I’ve removed the file-extension-based
stuff entirely and rewritten it to use globbing.

Tested locally that:
- changing `server.js` or `.env` causes the app to restart
- changing a file inside `node_modules` _doesn’t_ cause the app to
  restart

* Make it more difficult to accidentally clear the session data

* Changelog entry

* Move clears data page to prototype-admin

* Update title and put back link before the content

* Allow nested objects in session

E.g.

<input name="example1[name]" value="Hello 123">
<input name="example2[name]" value="Hello 456">
<input name="example3[name]" value="Hello 789">

* Clear session with empty object

Compatibility with other session stores that have no `.destroy()` method

* Add config to allow permanent session in cookie

Persists data between Node.js restarts

* Use path to gulp executable for spawn

Previously the spawn command just took `gulp` as an argument, which worked when running the app via `npm start`. However, running `node start` would fail because it couldn't find `gulp`. It would look globally, whereas `npm start` would look locally. Referencing the path within `node_modules` directly means both commands can be used to start and run the app.

* Update changelog with entry for gulp executable issue

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Update tips-and-tricks.md

* Update GOV.UK Frontend to 2.0.0

* Document in CHANGELOG

* Release v8.0.0

* Update wording on when Protoype Kit
started using GOV.UK Frontend  instead
of GOV.UK Elements

Needs updating now that we have release version 8.

* Update GOV.UK Frontend dependency to 2.1.0

* Use header macro instead of HTML

We have done the work to allow attributes to be added to navigation
items, which means we can now use the macro instead of plain HTML

* Document in CHANGELOG

* Release v8.1.0

* Set stylesheet media to all

In GOV.UK Frontend components no longer have separate print stylesheet;
print styles are built into the component partials

By setting media to all we allow those styles to apply in print situations.

* Document in CHANGELOG

* fix About link in nav

* Use form POST request when clearing session data

This builds on the work done in #588.

Previously the ‘clear data’ feature used two GET requests – one to display the confirmation screen, and a second to actually clear the session data. This is not ideal because GET requests are meant to be nullipotent (to have no side effects), and links from the docs part of the kit were still pointing to the old URL, which bypassed the confirmation screen.

This adds a form to the confirmation screen which POSTs to itself (/prototype-admin/clear-data), and changes the old data-clearing route to match.

* Use consistent page titles

* Document in changelog

* Update GOV.UK Frontend dependency

Update to v2.2.0

* Import character-count component

Make it available in the app views

* Document in CHANGELOG

* Release 8.2.0

* Heroku review app config

Required config to enable review apps on Heroku

* Fixed path for page templates in tutorials-and-examples

The site referred to docs/views/examples, which was incorrect.

* Add first draft of Notify integration guidance

Adapted from: https://gist.github.com/quis/1136d255a5cdc47f4b72bc5bf234cf97

* Rewrite instructions to add more context

The previous instructions were a very bare-bones draft which assumed a
lot of context.

This commit attempts to rewrite them for someone without knowledge of
what Notify is, or how an API works.

Hopefully this is enough so that someone who is confident using the
prototype kit can integrate their prototype with Notify.

* Remove duplicate send/sent

* Remove use of shell redirection to save key

* Capitalise GitHub

* Remove unneeded explanation of  variable

* Use HTML not macro for form example

* Fix line telling people where to put routing code

* Add CHANGELOG entry

* Add link to docs about using Notify

* Tidy code block in Notify guidance

* Removed dependency

* Add npm install reminder on crash

* Add standardjs and supertest to dev dependencies

* Setup exclusion list for the generated ZIP download

Make use of `.gitattributes` file to list all files that we don't want
to include in the ZIP users download.

As per https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_exporting_your_repository

* Update govuk-frontend to 2.3.0

* Document in CHANGELOG

* Add step by step navigation

* remove data-track-count (seems unused here)

* remove tracking code

* refactor scss

* fix javascript for Standard

* Changelog

* Release 8.3.0

* Fix list of excluded styles

* Move closing H1 tag onto the same line as the opening tag

In prototype kit training some users were confused by the fact that the closing tag was not on the same line as the opening tag – inconsistent with the paragraph tags in the same file.

* Avoid double-nested buttons in step-by-step navigation

Instead, these are added by JS automatically

* Link to new GOV.UK Notify documentation

We’re now publishing our documentation using the tech docs tool, and hosting it at https://docs.notifications.service.gov.uk/node.html

* Make unbranded layout available in app views

* Enable global styles in unbranded.css

* Document in CHANGELOG

* Update GOV.UK Frontend to v2.4.0

* Release v8.4.0

New features:

- [#642 Update GOV.UK Frontend to v2.4.0](alphagov/govuk-prototype-kit#642)

Bug fixes:

- [#634 Avoid double-nested buttons in step-by-step navigation](alphagov/govuk-prototype-kit#634)

- [#638 Make unbranded template available for use in app/views](alphagov/govuk-prototype-kit#638)

* Initial commit of moving tests over to Jest

After running jest-codemon

* Rename test to __tests__

* Removes gulp mocha

I was able to get rid of the gulp task and just call it straight from
`npm test`.

* Move listener to listen-on-port.js

This listener which looks out for file changes using BrowserSync doesn't need
to be part of `server.js` as it's only needed for npm start. We added a new file called
`listen-on-port.js` - this needs to be separate from `server.js` for Jest to work
correctly.

More detail here:
http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/#2-Separate-your-app-and-sever

* Add changelog

* Revert "Replacing Mocha with Jest"

* Initial commit of moving tests over to Jest

After running jest-codemon

* Rename test to __tests__

* Removes gulp mocha

I was able to get rid of the gulp task and just call it straight from
`npm test`.

* Move listener to listen-on-port.js

This listener which looks out for file changes using BrowserSync doesn't need
to be part of `server.js` as it's only needed for npm start. We added a new file called
`listen-on-port.js` - this needs to be separate from `server.js` for Jest to work
correctly.

More detail here:
http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/#2-Separate-your-app-and-sever

* Add changelog

* Start listen-on-port.js for Heroku

* updates support details

I tried to follow the pattern we use in Design System
https://design-system.service.gov.uk/#support

* Add note about frontend survey to README

* Test forceHttps functionality

Add tests that check that on production HTTP requests
 are redirected to HTTPS

* Refactors force-https-redirect.js specs

There is no need to have before/after all hooks if specs dont require us
to change environment variables

* Fix link context in step-by-step templates
Link context (price) wasn't showing correctly previously

* Document in changelog

* Revert "Add note about frontend survey to README"

* Moves basicAuth out of lib/utils.js

This is the first step to improving our implementation of middleware and
and testing stragety. It extracts the basicAuth method in utils.js and
places it into its own file. This will be easier to test and manage. At
this point it has only been manually test on a local machine but automated
unit tests will be added next.

* Adds basic unit tests for authentication

This unit test just tests the middleware in its current state. Ideally
we should only add this functionality to production environment or
if the user specifically needs to have basic auth enabled.

The next bit of work will be to move the logic out of the server.js into
the middleware itself.

* Refactor authentication to use console.error

* Moves middleware logic from server.js to authentication.js

Easy to manage/maintain and Developers can see when the middleware would
be applied and when. The middleware is not completely independant from the
rest of the server configuration.

* Adds unit tests for when the kit is running in non-prod environment

* Bump GOV.UK Frontend to latest release

* Gulp 4.0.0 upgrade

- upgrade gulp to 4.0.0
- substitute gulp-clean for del
- remove reliance on run-sequence by using in-built gulp functions

* Update CHANGELOG.md

- add PR #659 to changelog

* Grouped dependencies

- group dependencies to GOV.UK standard

* Update watch.js

- replace gulp.series on watch tasks with gulp.task

* Gulp task improvements

- fix public path for clean task
- run clean task before all others

* update Standard

* standard 12 fixes

* changelog

* Replaces gutil-color with ansi-colors

* Replaces gutil.log with fancy logs

* Removes gulp-util as its now deprecated

gulp-util is deprecated - replace it, following the guidelines at
https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

We only used this for logging and colouring our log outputs.

* Adds entry to changelog

* Add acorn dependency to fix npm warning

It seems there is a problem with npm installing 'peer dependencies'
npm's warning says that we need to install this dependency ourselves.
The bug is tracked here:
eslint/eslint#11018

* changelog

* Move acorn to dependency

We dont really need it but its needed for Standard and gulp-sourcemaps.

Heroku removes dev dependency by default.

* updates changelog

* Update GOV.UK Frontend to version 2.5.0

* Import new components Accordion and Summary List

* Update CHANGELOG

* Replace check answers pattern with updated code

* Update button text and licence period content

* changelog

* Release 8.5.0

* Update GOV.UK Frontned to version 2.6.0

* Release 8.6.0
fofr added a commit to DFE-Digital/publish-teacher-training-prototype that referenced this pull request Mar 8, 2019
* Update run-sequence from 1.2.2 to 2.2.1

Tested by ensuring that the gulp tasks in gulp/tasks.js that use run-sequence still run without error.

* Update standard from 10.0.2 to 11.0.1 and fix violations

* Update sync-request from 4.1.0 to 6.0.0

Tested by ensuring that the release url on the `/docs/install` page is still generated correctly (sync-request is only used by the getLatestRelease in lib/utils, which is used on the /docs/install page to automatically link to the latest release from GitHub)

* Document changes in changelog

* Update govuk-frontend dependency to 1.1.1

* Unify download link approach

Within the docs we link to `/prototype-admin/download-latest` which looks up the latest release from GitHub and redirects to the zip download.

On the install page itself, we look up the latest release URL and then link directly to GitHub from the page.

This moves the `/prototype-admin/download-latest` to `/docs/install` so that it can live within the docs folder and unifies the two approaches so that we consistently use the `/docs/download` URL. This means that we are no longer blocking on a GitHub request before we can render the install page – and that we only make the request to GitHub if the user actually tries to download the kit.

* Simplify getLatestRelease logic

- Rather than trying to extract the tag name from the zipball URL, use the value of `name` that we get in the response data
- Use template literals to build the zip URL rather than multiple variables and concatenation
- Avoid assigning things to variables that aren't used more than once (githubUrl, options) which also reduces the amount of seeking you have to do through the code
- Remove url, zipUrl variables by assigning to releaseUrl directly and `return`ing from every scenario

* Specify node dependency using caret notation

This fixes an issue when deploying to CloudFoundry instances (such as GOV.UK PaaS) where the buildpack fails on the semver range:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): >=8.9.1 <9.0
          engines.npm (package.json): unspecified (use default)
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
          **ERROR** Unable to install node: improper constraint: >=8.9.1 <9.0
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
```

Using ^8.9.1 instead which is semantically equivalent (any version greater than 8.9.1 but less than 9.0) allows the app to deploy successfully:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): ^8.9.1
          engines.npm (package.json): unspecified (use default)
   -----> Installing node 8.11.3
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-8.11.3-linux-x64-34b80d71.tgz]
```

* Document in changelog

* Add data- tracking attributes to docs/index page

* Add data- tracking attributes to header navigation

Unfortunately at the moment we cannot pass
data attributes to items, so we have to replace
the Nunjucks macro with HTML.

* Add example of using data in Nunjucks macros

* Document in CHANGELOG

* Simplify start page

As seen in this PR: alphagov/govuk-frontend#807

* Improve error handling

- Use 'next' and middleware to handle errors, this is the documented way to handle errors in Express
- Use console.error to output errors when rendering templates - these were previously hidden
- Remove custom route for index.html, handle it with matchRoutes for consistency

* update changelog

* Document steps needed when updating the kit

from version beta-9 to beta-10

* Update GOV.UK Frontend to 1.2.0

* Document in CHANGELOG

* Add Elements, Frontend Toolkit and GOV.UK Template modules

* Add gulp tasks for v6 support

* create v6 app to serve old prototype files from app/v6

* add backward compatibility documentation

* update changelog

* support old unbranded template

* v7.0.0

* Update install-the-kit.md

- correct reference to '3.0.0' folder
- simplify instructions for just installation, not returning
- drop instructions for 'My Documents' - this was for Windows older than Vista apparently

* Update template-question-page-blank.html

Link to the home page instead of the Question page pattern - people could need any of the components or patterns, not necessarily guidance on the Question page itself

* Update CHANGELOG.md

* rename and reorganise template pages to be easier to use

* update changelog

* Add prototype kit version and github link to footer

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Add item to CHANGELOG for adding kit version to footer

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Amend prototype kit link to go to heroku site

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Changed block name to bodyEnd to fix scripts

* Update CHANGELOG.md

* Update GOV.UK Frontend to 1.3.0

* Document in CHANGELOG

* Load environment variables before requiring routes

Code in `route.js` may be looking for environment variables. If the environment variables aren’t loaded beforehand this will cause an exception.

I suspect this worked fine before alphagov/govuk-prototype-kit@bbe15e8#diff-78c12f5adc1848d13b1c6f07055d996e, which reordered the first lines in `server.js`.

This commit moves the loading of environment variables to before the requiring of any `routes.js` files.

* CHANGELOG

* v7.1.0

* Updating deprecated support email address

* Restart the app if environment variables change

Could be confusing why your changes aren’t having any effect.

Doing this using the existing file-extension-based config doesn’t work
because nodemon doesn’t undestand that `.env` is a file with no name,
and an extension of `env`. So I’ve removed the file-extension-based
stuff entirely and rewritten it to use globbing.

Tested locally that:
- changing `server.js` or `.env` causes the app to restart
- changing a file inside `node_modules` _doesn’t_ cause the app to
  restart

* Make it more difficult to accidentally clear the session data

* Changelog entry

* Move clears data page to prototype-admin

* Update title and put back link before the content

* Allow nested objects in session

E.g.

<input name="example1[name]" value="Hello 123">
<input name="example2[name]" value="Hello 456">
<input name="example3[name]" value="Hello 789">

* Clear session with empty object

Compatibility with other session stores that have no `.destroy()` method

* Add config to allow permanent session in cookie

Persists data between Node.js restarts

* Use path to gulp executable for spawn

Previously the spawn command just took `gulp` as an argument, which worked when running the app via `npm start`. However, running `node start` would fail because it couldn't find `gulp`. It would look globally, whereas `npm start` would look locally. Referencing the path within `node_modules` directly means both commands can be used to start and run the app.

* Update changelog with entry for gulp executable issue

Signed-off-by: Mike Shaw <mike.shaw@dwp.gsi.gov.uk>

* Update tips-and-tricks.md

* Update GOV.UK Frontend to 2.0.0

* Document in CHANGELOG

* Release v8.0.0

* Update wording on when Protoype Kit
started using GOV.UK Frontend  instead
of GOV.UK Elements

Needs updating now that we have release version 8.

* Update GOV.UK Frontend dependency to 2.1.0

* Use header macro instead of HTML

We have done the work to allow attributes to be added to navigation
items, which means we can now use the macro instead of plain HTML

* Document in CHANGELOG

* Release v8.1.0

* Set stylesheet media to all

In GOV.UK Frontend components no longer have separate print stylesheet;
print styles are built into the component partials

By setting media to all we allow those styles to apply in print situations.

* Document in CHANGELOG

* fix About link in nav

* Use form POST request when clearing session data

This builds on the work done in #588.

Previously the ‘clear data’ feature used two GET requests – one to display the confirmation screen, and a second to actually clear the session data. This is not ideal because GET requests are meant to be nullipotent (to have no side effects), and links from the docs part of the kit were still pointing to the old URL, which bypassed the confirmation screen.

This adds a form to the confirmation screen which POSTs to itself (/prototype-admin/clear-data), and changes the old data-clearing route to match.

* Use consistent page titles

* Document in changelog

* Update GOV.UK Frontend dependency

Update to v2.2.0

* Import character-count component

Make it available in the app views

* Document in CHANGELOG

* Release 8.2.0

* Heroku review app config

Required config to enable review apps on Heroku

* Fixed path for page templates in tutorials-and-examples

The site referred to docs/views/examples, which was incorrect.

* Add first draft of Notify integration guidance

Adapted from: https://gist.github.com/quis/1136d255a5cdc47f4b72bc5bf234cf97

* Rewrite instructions to add more context

The previous instructions were a very bare-bones draft which assumed a
lot of context.

This commit attempts to rewrite them for someone without knowledge of
what Notify is, or how an API works.

Hopefully this is enough so that someone who is confident using the
prototype kit can integrate their prototype with Notify.

* Remove duplicate send/sent

* Remove use of shell redirection to save key

* Capitalise GitHub

* Remove unneeded explanation of  variable

* Use HTML not macro for form example

* Fix line telling people where to put routing code

* Add CHANGELOG entry

* Add link to docs about using Notify

* Tidy code block in Notify guidance

* Removed dependency

* Add npm install reminder on crash

* Add standardjs and supertest to dev dependencies

* Setup exclusion list for the generated ZIP download

Make use of `.gitattributes` file to list all files that we don't want
to include in the ZIP users download.

As per https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_exporting_your_repository

* Update govuk-frontend to 2.3.0

* Document in CHANGELOG

* Add step by step navigation

* remove data-track-count (seems unused here)

* remove tracking code

* refactor scss

* fix javascript for Standard

* Changelog

* Release 8.3.0

* Fix list of excluded styles

* Move closing H1 tag onto the same line as the opening tag

In prototype kit training some users were confused by the fact that the closing tag was not on the same line as the opening tag – inconsistent with the paragraph tags in the same file.

* Avoid double-nested buttons in step-by-step navigation

Instead, these are added by JS automatically

* Link to new GOV.UK Notify documentation

We’re now publishing our documentation using the tech docs tool, and hosting it at https://docs.notifications.service.gov.uk/node.html

* Make unbranded layout available in app views

* Enable global styles in unbranded.css

* Document in CHANGELOG

* Update GOV.UK Frontend to v2.4.0

* Release v8.4.0

New features:

- [#642 Update GOV.UK Frontend to v2.4.0](alphagov/govuk-prototype-kit#642)

Bug fixes:

- [#634 Avoid double-nested buttons in step-by-step navigation](alphagov/govuk-prototype-kit#634)

- [#638 Make unbranded template available for use in app/views](alphagov/govuk-prototype-kit#638)

* Initial commit of moving tests over to Jest

After running jest-codemon

* Rename test to __tests__

* Removes gulp mocha

I was able to get rid of the gulp task and just call it straight from
`npm test`.

* Move listener to listen-on-port.js

This listener which looks out for file changes using BrowserSync doesn't need
to be part of `server.js` as it's only needed for npm start. We added a new file called
`listen-on-port.js` - this needs to be separate from `server.js` for Jest to work
correctly.

More detail here:
http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/#2-Separate-your-app-and-sever

* Add changelog

* Revert "Replacing Mocha with Jest"

* Initial commit of moving tests over to Jest

After running jest-codemon

* Rename test to __tests__

* Removes gulp mocha

I was able to get rid of the gulp task and just call it straight from
`npm test`.

* Move listener to listen-on-port.js

This listener which looks out for file changes using BrowserSync doesn't need
to be part of `server.js` as it's only needed for npm start. We added a new file called
`listen-on-port.js` - this needs to be separate from `server.js` for Jest to work
correctly.

More detail here:
http://www.albertgao.xyz/2017/05/24/how-to-test-expressjs-with-jest-and-supertest/#2-Separate-your-app-and-sever

* Add changelog

* Start listen-on-port.js for Heroku

* updates support details

I tried to follow the pattern we use in Design System
https://design-system.service.gov.uk/#support

* Add note about frontend survey to README

* Test forceHttps functionality

Add tests that check that on production HTTP requests
 are redirected to HTTPS

* Refactors force-https-redirect.js specs

There is no need to have before/after all hooks if specs dont require us
to change environment variables

* Fix link context in step-by-step templates
Link context (price) wasn't showing correctly previously

* Document in changelog

* Revert "Add note about frontend survey to README"

* Moves basicAuth out of lib/utils.js

This is the first step to improving our implementation of middleware and
and testing stragety. It extracts the basicAuth method in utils.js and
places it into its own file. This will be easier to test and manage. At
this point it has only been manually test on a local machine but automated
unit tests will be added next.

* Adds basic unit tests for authentication

This unit test just tests the middleware in its current state. Ideally
we should only add this functionality to production environment or
if the user specifically needs to have basic auth enabled.

The next bit of work will be to move the logic out of the server.js into
the middleware itself.

* Refactor authentication to use console.error

* Moves middleware logic from server.js to authentication.js

Easy to manage/maintain and Developers can see when the middleware would
be applied and when. The middleware is not completely independant from the
rest of the server configuration.

* Adds unit tests for when the kit is running in non-prod environment

* Bump GOV.UK Frontend to latest release

* Gulp 4.0.0 upgrade

- upgrade gulp to 4.0.0
- substitute gulp-clean for del
- remove reliance on run-sequence by using in-built gulp functions

* Update CHANGELOG.md

- add PR #659 to changelog

* Grouped dependencies

- group dependencies to GOV.UK standard

* Update watch.js

- replace gulp.series on watch tasks with gulp.task

* Gulp task improvements

- fix public path for clean task
- run clean task before all others

* update Standard

* standard 12 fixes

* changelog

* Replaces gutil-color with ansi-colors

* Replaces gutil.log with fancy logs

* Removes gulp-util as its now deprecated

gulp-util is deprecated - replace it, following the guidelines at
https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

We only used this for logging and colouring our log outputs.

* Adds entry to changelog

* Add acorn dependency to fix npm warning

It seems there is a problem with npm installing 'peer dependencies'
npm's warning says that we need to install this dependency ourselves.
The bug is tracked here:
eslint/eslint#11018

* changelog

* Move acorn to dependency

We dont really need it but its needed for Standard and gulp-sourcemaps.

Heroku removes dev dependency by default.

* updates changelog

* Update GOV.UK Frontend to version 2.5.0

* Import new components Accordion and Summary List

* Update CHANGELOG

* Replace check answers pattern with updated code

* Update button text and licence period content

* changelog

* Release 8.5.0

* Update GOV.UK Frontned to version 2.6.0

* Release 8.6.0

* add guidance for CSS, JavaScript and images

* Test on on macOS and Windows and both Node 10 / 8

Update the Travis config to build on both macOS and Windows as well as Linux, and against both Node 8 and LTS (currently 10)

Travis combines the OS and Node JS versions, so both Node versions will be tested on every operating system.

There is a known issue with Windows builds on Travis where the build fails if you have encrypted variables.

Splitting the deploy step (which is the step that requires the encrypted variable) into its own job means that the encrypted variables are not present when testing on Windows.

* Remove before_deploy step

Each stage runs one after another, but will only proceed if all jobs in the previous stage have passed successfully, so this check is not necessary.

* Add new deploy key for Travis

In order to make the tests pass on Windows, we need to remove any encrypted variables from the Travis repository settings and specify them in the repo config file instead.

This adds a new deploy key encrypted using an encrypted env variable DEPLOY_KEY and updates the release script to use it.

Co-authored-by: Hanna Laakso <hanna.laakso@digital.cabinet-office.gov.uk>

* Tidy up config and release script

* Update documentation for create-release

* Remove verification

The SSH command will always exit with an error code, even if it connects successfully, because GitHub does not provide shell access.

We could allow this to fail, but we're not sure it's that useful, so let's just remove it for now.

* update docs and package.json to Node 10 LTS

* Adds Extension Framework for departments to use their own frontend system

As a developer/Designer, I would like to use my departments frontend system
alongside govuk-frontend. So that I can prototype using the same components
and patterns that will be used in production.

This should not be a breaking change for any existing kits.
This is a soft release where GOV.UK Design System team would like HMRC
to test before releasing this more widely.

A proper release with documentation etc. will be done once this has been
battle tested with HMRC.

Co-authored-by: Alistair Laing <alistair.laing@digital.cabinet-office.gov.uk>
Co-authored-by: Hanna Laakso <hanna.laakso@digital.cabinet-office.gov.uk>

* Update govuk-frontend from 2.6.0 to 2.7.0

This is so we can pick up govuk-prototype-kit.config.json file which
was added to govuk-frontend to support this extensions feature.

* Fixed extensions for windows (including tests).

* Release 8.7.0

* Don't include travis files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants